//
//  CapacityTableViewCell.m
//  SBooks
//
//  Created by shansander on 2016/12/2.
//  Copyright © 2016年 shansander. All rights reserved.
//

#import "CapacityTableViewCell.h"
#import "AppCustom.h"

@implementation CapacityTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
    self.backgroundColor = [UIColor clearColor];
    self.theRamLabel.text = @"123.0MB";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)displayFileSize:(NSInteger)filesize
{
    self.theRamLabel.text = [AppCustom CalculatesFileSize:@(filesize)];
}
- (void)displayRamWithFileSizeInfo:(NSDictionary *)filesizeInfo
{
    __block NSInteger file_size_sum = 0;
    [filesizeInfo enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
        NSNumber * file_size = obj;
        file_size_sum += file_size.integerValue;
    }];
    [self displayFileSize:file_size_sum];
}
@end
